package selenium;

/**
 * Created by 1 on 06.04.2014.
 */

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import pages.HomePage;
import util.ReportWriter;


public class NegativeAuthorisation extends TestConditions
{

    @DataProvider(name = "loginTest")
    public Object[][] provideData()
    {
        return new Object[][]
                {
                        new Object[] {"vivaniv@i.ua", ""},
                                     {"vivaniv", "vivaniv321"},
                                     {"#%$", "vivaniv321"},
                };
    }

    @Test(dataProvider = "loginTest")
    public void logIn(String email,String password)
    {
        driver.manage().deleteAllCookies();
        HomePage homePage = new HomePage(driver);
        homePage.open();
        homePage.logIn(email,password);
        Assert.assertFalse(homePage.isLoggedIn(), ReportWriter.error("Negative logIn test FAILED"));
    }
}

